# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : 鸢尾花_数据可视化展示.py
# @Author: dongguangwen
# @Date  : 2025-01-19 15:36
# 0.导入工具包
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import load_iris

# 1.加载数据集
iris_data = load_iris()
# print(iris_data)
# print(iris_data.feature_names)

# 2.数据展示
iris_df = pd.DataFrame(iris_data['data'], columns=iris_data.feature_names)
iris_df['label'] = iris_data['target']
print(iris_df.head(5))
print(iris_data.feature_names)
sns.lmplot(x='sepal length (cm)', y='sepal width (cm)', data=iris_df, hue='label')
plt.show()

"""
   sepal length (cm)  sepal width (cm)  ...  petal width (cm)  label
0                5.1               3.5  ...               0.2      0
1                4.9               3.0  ...               0.2      0
2                4.7               3.2  ...               0.2      0
3                4.6               3.1  ...               0.2      0
4                5.0               3.6  ...               0.2      0

[5 rows x 5 columns]
['sepal length (cm)', 'sepal width (cm)', 'petal length (cm)', 'petal width (cm)']
"""